﻿using Ags.MonsterTools.Common;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;

namespace Ags.MonsterTools.PingTool
{
    public class PingModuleLoader : IModule
    {
        private readonly IViewManager _vm;
        private readonly IUnityContainer _container;

        public PingModuleLoader(IViewManager vm, IUnityContainer container)
        {
            _container = container;
            _vm = vm;
        }

        public void Initialize()
        {
            _container.RegisterType<PingView>("Ping", new ContainerControlledLifetimeManager());
            _vm.NavigateToView(typeof(PingView), RegionConstants.MAINCONTENTREGION, "Ping");
        }
    }
}
